import torch

def get_conv_output_size(input_shape, model):
    with torch.no_grad():
        x = torch.zeros(1, *input_shape).to(next(model.parameters()).device)
        x = model.pool1(torch.relu(model.conv1(x)))
        x = model.pool2(torch.relu(model.conv2(x)))
        x = model.pool3(torch.relu(model.conv3(x)))
        return x.numel()
